<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>个人信息</title>
    <script type="text/javascript" src="__PUBLIC__/Js/jquery-validation-1.14.0/lib/jquery-1.11.1.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Js/jquery-validation-1.14.0/dist/jquery.validate.js"></script>
    <!-- <script type="text/javascript" src="__PUBLIC__/Js/home/jquery-1.11.3.js"></script> -->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/home/user_common.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/home/user_main_left.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/home/personInfo.css">
    <style>
        input.error {
            border: 1px solid red;
        }

        label.error {
            background: url("./demo/images/unchecked.gif") no-repeat 0px 0px;
            padding-left: 16px;
            padding-bottom: 2px;
            font-weight: bold;
            color: #EA5200;
        }

        label.checked {
            background: url("./demo/images/checked.gif") no-repeat 0px 0px;
        }

        .person-cort_left-write {
            margin-bottom: 12px;
            overflow: hidden;
            line-height: 24px;
            font-size: 14px;
        }
    </style>
</head>
<body>
<!--引入页面头部-->
<include file="Common/header"/>
<!--网页主体-->
<div class="cort">
    <div class="cmain mb_back">
        <div class="zbk_top spalid">
            <span>您当前的位置：</span>
            <span><a href="__MODULE__/Index/index" target="_top">Darry Ring</a></span>
            <span><em>&gt;</em></span>
            <span><a href="__MODULE__/User/index" target="_top">我的DR</a></span>
            <span><em>&gt;</em></span>
            <span>个人信息</span>
        </div>
        <!--中间内容-->
        <div class="member_cort">
            <!--引入左导航栏-->
            <include file="Common/user_main_left"/>
            <!--右边的主要内容-->
            <div class="member_cort-right fr">
                <!--我的个人信息-->
                <div class="member_person">
                    <div class="member_ask-tittle">
                        <h4>
                            我的个人信息
                        </h4>
                        <p>
                            为了能给您提供个性化服务，请完善您的基本资料。
                        </p>
                    </div>
                    <!--个人信息填写-->
                    <form method="post" action="__MODULE__/User/personInfo_change" enctype='multipart/form-data' id='form'>
                        <div class="member_person-cort">
                            <!--左边-->
                            <div class="member_person-cort_left">
                                <div class="person-cort_left-word">
                                    <span>用户名：{$result.0.username}</span><span id="sp_email"></span>
                                </div>
                                <div class="person-cort_left-word person-cort_left-spword">
                                    <span>可享受更多DarryRing为您提供的贴心服务与提醒通知。</span>
                                </div>
                                <div id="div_email" class="person-cort_left-write">
                                    <span>邮&nbsp;&nbsp;&nbsp;&nbsp;箱：</span>
                                    <input id="email" class="write_text" value="{$result.0.email}" type="text" name='email'>
                                    <span id="shrid1" style="display: none;"><i class="writer_wrong"></i><em class="writer_word" id="shrwrong1"></em></span><span style="display: none;" id="shry1"><i class="writer_right"></i></span>
                                </div>
                                <div class="person-cort_left-write">
                                    <span>真实姓名：</span>
                                    <input id="truename" class="write_text" value="{$result.0.truename}" type="text" name="truename">
                                    <span id="realId" style="display: none;"><i class="writer_wrong"></i><em class="writer_word" id="realwrong"></em></span><span style="display: none;" id="realy"><i class="writer_right"></i></span>
                                </div>
                                <div class="person-cort_left-write">
                                    <span>身份证号：</span>
                                    <input id="id_card" class="write_text" value="{$result.0.id_card}" type="text" name='id_card'>
                                    <span id="realId" style="display: none;"><i class="writer_wrong"></i><em class="writer_word" id="realwrong"></em></span><span style="display: none;" id="realy"><i class="writer_right"></i></span>
                                </div>
                                <div class="person-cort_left-write">
                                    <span>性&nbsp;&nbsp;&nbsp;&nbsp;别：</span>
                                    <input type="radio" value="1" checked name="sex" id="ctl00_content_nan">
                                    <label for="nan">
                                        男</label>
                                    <input type="radio" value="0" name="sex" id="ctl00_content_nv">
                                    <label for="nv">
                                        女</label>
                                    <!-- </div>
                                    <div class="person-cort_left-write">
                                        <span>出生日期：</span>
                                        <select id="selYear">

                                        <select id="selMonth">

                                        <select id="selDay">

                                    </div> -->


                                    <div class="person-cort_left-write" style="">
                                        <div class="control-group">
                                            <span>地&nbsp;&nbsp;&nbsp;&nbsp;区：</span>

                                            <select name="location_p" id="location_p">
                                            </select>
                                            <select name="location_c" id="location_c">
                                            </select>
                                            <select name="location_a" id="location_a">
                                            </select>
                                            <script src="__PUBLIC__/Js/home/region_select.js"></script>
                                            <script type="text/javascript">
                                                new PCAS('location_p', 'location_c', 'location_a', '', '', '');
                                            </script>

                                            </select>
                                        </div>
                                        <div class="person-cort_left-write" style="">
                                            <span class="write_vtop">详细地址：</span>
                                            <textarea name="d_address" rows="2" cols="20" id="street">{$result.0.d_address}</textarea>
                                            <span style="display: none;" id="streid"><i class="writer_wrong"></i><em class="writer_word" id="strewrong"></em></span><span style="display: none;" id="strey"><i class="writer_right"></i></span>
                                        </div>
                                        <div class="person-cort_left-write" style="">
                                            <span>邮政编码：</span>
                                            <input id="code" class="write_text" value="{$result.0.code}" type="text" name='code'>
                                            <span style="display: none;" id="postid"><i class="writer_wrong"></i><em class="writer_word" id="postwrong"></em></span><span style="display: none;" id="posty"><i class="writer_right"></i></span>
                                        </div>
                                        <div class="person-cort_left-write" style="">
                                            <span class="fl">手&nbsp;&nbsp;&nbsp;&nbsp;机：</span>
                                            <input id="tel" class="write_text fl" value="{$result.0.tel}" type="text" name='tel'>
                                            <span style="display: none;" id="sjid"><i class="writer_wrong"></i><em class="writer_word" id="sjwrong"></em></span><span style="display: none;" id="sjy"><i class="writer_right"></i></span>
                                        </div>
                                        <div style='margin-left: 100px;'>
                                            <input type="submit" value='>保存'
                                                   style="height:35px;width:100px;background:#D6B870;color:#FFFFFF;font-size:18px;">
                                        </div>
                                    </div>
                                    <!--左边end-->
                                    <!--右边-->
                                    <!-- <div class="member_person-cort_right">
                                        <a href="#">
                                            <img src="__PUBLIC__/Images/home/mem.jpg" height="90" width="90">
                                        </a>
                                        <p>
                                            <a href=#>更换头像</a>
                                        </p>
                                    </div> -->
                                    <!--右边end-->
                                </div>
                                <!--个人信息填写end-->
                            </div>
                            <!--我的个人信息end-->
                        </div>
                        <!--右边的主要内容end-->
                </div>
                <!--中间内容end-->
            </div>
            <!--内容end-->
        </div>
        <!--中间end-->
    </div>
</div>
<!--引入页面底部-->
<include file='Common/footer'/>
</body>
</html>
<script>
    $(function () {
        // $('.text-word').click(function(){
        //   if($('#form').valid())
        //   {
        //     $('#form').submit();
        //   }
        // })

        $('#form').validate({
            rules: {
                tel: {
                    required: true,
                    minlength: 11,
                    // 自定义方法：校验手机号在数据库中是否存在
                    // checkPhoneExist : true,
                    isMobile: true,
                },
                code: {
                    minlength: 6,
                },

                truename: {
                    required: true,
                    minlength: 2,
                },


                id_card: {
                    required: true,
                    digits: true,
                    minlength: 18,
                },

                email: {
                    required: true,
                    email: true,

                },
            },
            messages: {
                tel: {
                    required: "* 请输入手机号",
                    minlength: "* 确认手机不能小于11个字符",
                    isMobile: "* 请正确填写您的手机号码",
                },

                code: {
                    minlength: "* 请输入6位数邮政编码",
                },

                truename: {
                    required: '* 姓名不能为空，且为真实姓名',
                    minlength: "* 请输入合法姓名",
                },

                id_card: {
                    required: '* 不能为空',
                    digits: '* 密码必须为纯数字',
                    minlength: '* 长度必须为18位数',
                },
                email: {
                    required: '* 不能为空',
                    email: '* 请输入正确邮箱',
                },
            }

        });
        jQuery.validator.addMethod("isMobile", function (value, element) {
            var length = value.length;
            var mobile = /^(((13[0-9]{1})|(15[0-9]{1}))+\d{8})$/;
            return (length == 11 && mobile.exec(value)) ? true : false;
        }, "请正确填写您的手机号码");

    });
</script>